package org.lc.service.system.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.lc.platform.base.result.Result;
import org.lc.platform.mybatis.crud.controller.CrudBaseController;
import org.lc.service.system.dto.SysLoggerDto;
import org.lc.service.system.entity.SysLogger;
import org.lc.service.system.service.SysLoggerService;
import org.lc.service.system.vo.SysLoggerVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/logger")
@Validated
@Tag(name = "日志模块")
public class SysLoggerController extends CrudBaseController<SysLogger, SysLoggerVo, SysLoggerDto, SysLoggerService> {
    public SysLoggerController(SysLoggerService service) {
        super(service);
    }

    @Operation(summary = "查看详情")
    @GetMapping("/detail/{log}")
    private Result<Map<String,Object>> getLogDetail(@PathVariable("log") String log) {
        return Result.data(this.getService().getLogDetail(log));
    }
}